package Java学习;

import java.util.TreeSet;
import java.util.function.Consumer;

public class TreeSet练习 {
    public static void main(String[] args) {
        TreeSet<Student> ts = new TreeSet<>();
        Student s1 = new Student("zhansan", 23, 33, 34, 35, 33+34+35);
        Student s2 = new Student("lisi", 23, 33, 36, 34, 33+34+35);
        Student s3 = new Student("wangwu", 23, 33, 34, 35, 33+34+35);
        Student s4 = new Student("wangwu", 23, 33, 34, 35, 33+34+35);
        System.out.println(s1);
        ts.add(s1);
        ts.add(s2);
        ts.add(s3);
        ts.forEach(student -> System.out.println(student));
    }
}
